package gemini.pollux.ui.server.service.impl;

import gemini.basic.manager.ProductManager;
import gemini.basic.model.ProductType;
import gemini.pollux.ui.client.service.ProductTypeService;
import gemini.pollux.ui.server.service.AbstractSingleService;

import java.util.ArrayList;

public class ProductTypeServiceImpl extends
        AbstractSingleService<ProductManager> implements
        ProductTypeService {

	@Override
	public ArrayList<ProductType> getAllProductTypes() {
		ArrayList<ProductType> result = duplicate(getServerManager().getAllCategory());
    	return result;
	}

	@Override
	public void deleteProductType(Integer id) {
		getServerManager().deleteProductType(id);
	}

	@Override
	public ProductType saveOrUpdateProductType(ProductType productType) {
		ProductType result = duplicateExcludeFields(getServerManager().saveOrUpdateProductType(productType));
    	return result;
	}
}
